<template>
  <view class="container">
    <view class="header">
      <image class="header-logo" :src="image"></image>
      <text class="header-text">活动中心</text>
    </view>
    <view class="card invite" @click="goHuodongzongxinOne">
		
      <image style="width: 100%;height: 150px;" src="https://i-blog.csdnimg.cn/direct/384c6ffac55a4b38bea28a69e35fb0fa.png"></image>
    </view>
    <view class="card coupon">
      <image style="width: 100%;height: 150px;" src="https://i-blog.csdnimg.cn/direct/75d84f733f0847189c5d3a3bed3eaae5.png"></image>
    </view>
  </view>
</template>
<script setup>
		import {
			onShow,
			onLoad
		} from '@dcloudio/uni-app';
		import {url} from '@/utils/request.js'
import { ref } from 'vue';
	const goHuodongzongxinOne= () => {
	uni.navigateTo({
		url:'../huodongOne/huodongOne'
	})
	}
	const image = ref('')
	onLoad(()=>{
		uni.getStorage({
		key:'openId',
		success(res){
		uni.request({
			url: url + '/wx/selectUserByOpenId', // Example URL, replace with the real one.
			data: {
				openId: res.data
			},
			success(Res) {
				console.log(Res.data);
			    image.value= Res.data.data.userImg
		
			}
		});
		}
	})
	})
	
</script>
<style>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f5f5f5;
}

.header {
  width: 100%;
  height: 115px;
  display: flex;
  background-image: url('https://i-blog.csdnimg.cn/direct/e9caac161b3647cf9d68c85a6c283cec.png');
  align-items: center;
  padding: 0 20px;
  background-color: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.header-logo {
     width: 40px;
     height: 40px;
     margin-left: 39px;
     margin-right: 10px;
}

.header-text {
  font-size: 18px;
  color: #333;
}

.card {
    width: 90%;
    height: 150px;
    margin: 10px 0;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-image {
  width: 100%;
  height: auto;
}
</style>
